<!DOCTYPE html>
<html>
<head>
<title>侧边栏</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
    html,body,header,section,footer,nav,div,ul,ol,li,img,a,span,em,del,center,strong,var,fieldset,form,label,dt,dd,cite,input,hr,time,mark,code,figcaption,figure,textarea{
        margin:0;
        border:0;
        padding:0;
        font-family: "宋体";
        font-style:normal;
    }
html,body {
    -webkit-touch-callout:none;
    -webkit-text-size-adjust:none;
    -webkit-tap-highlight-color:rgba(0, 0, 0, 0);
    -webkit-user-select:none;
}
header,footer,section,nav,img,a,button,em,del,strong,var,fieldset,label,cite,small,time,mark,code,figcaption,figure,textarea{
    display:block;
}
header,section,footer,nav {
    position:relative;
    overflow:hidden;
}
ol,ul{
    list-style:none;
}
input,button,textarea {
    border:0;
    margin:0;
    padding:0;
    font-size:1em;
    line-height:1em;
    -webkit-appearance:none;
    background-color:rgba(0, 0, 0, 0);
}
span{
    display:inline-block;
}
a,a:visited{
    text-decoration:none;
}
body {
    background-color:#404040;
}
#main {
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    display:-webkit-box;
    -webkit-box-orient: vertical;
}
header {
    height:80px;
    background-color:#333333;
    display:-webkit-box;
    -webkit-box-orient:vertical;
}
header>div {
    display:-webkit-box;
    -webkit-box-pack:left;
    width: 100%;
    margin-left: 5%;  
    -webkit-box-align:start;
}
#logo {
   -webkit-box-flex:1;
   -webkit-box-align:center;
}
 
#logo>img {
    width:60px;
    vertical-align: middle;
}
 
#logo>span{
    font-size:18px;
    font-weight:bold; 
    padding: 15px 0px 10px 10px;     
    color:#fff;
}

#username{
    position: absolute;
    color:#fff;
    line-height:16px;
    font-size:16px;
    top:50%;
    left:80px;
    vertical-align: middle;
    margin-top: -8px;
}
section {
    -webkit-box-flex:1;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    background-color:#404040;
}
a {
    position:relative;
    -webkit-box-flex:1;
    
}
.ui {
    color:#fff;
    border-bottom:1px solid #333333;
	box-shadow:0 1px 0 #6e6e6e;
	width: 100%;
    display:-webkit-box;
    -webkit-box-orient:horizontal;
    overflow: hidden;
}

.navmenu {
    color:#fff;
    border-bottom:1px solid #333333;
	box-shadow:0 1px 0 #6e6e6e;
	width: 100%;
    display:-webkit-box;
    -webkit-box-orient:horizontal;
    overflow: hidden;
 }
.function {
    color:#fff;
    border-bottom:1px solid #333333;
	box-shadow:0 1px 0 #6e6e6e;
	width:100%;
    display:-webkit-box;
    -webkit-box-orient:horizontal;
    overflow: hidden; 
}
 
 
a>.img {
    position: absolute;
    width:30px;
    height:30px;
    margin-left:30px;
    line-height:16px;
    font-size:16px;
    top:50%;
    margin-top: -15px;
    
}
a>.info{
    position: absolute;
    margin-left:10px;
    line-height:16px;
    font-size:16px;
    top:50%;
    left:80px;
    vertical-align: middle;
    margin-top: -8px;
}
a>em {
    position:absolute;
    top:23px;
    right:47px;
    width:18px;
    height:18px;
    background-color:#333333;
    -webkit-border-radius:3px;
    color:#3c7390;
    font-size:10px;
    line-height:18px;
    text-align:center;
}
 
 
.copy_v{
    width: 90%;
    margin-right:auto;
    margin-left:auto;
    
}
.copy_v>img{
   width:25%;
   margin:0px 20%;
} 
.copy_v>span{
    width: 50%;
    margin:5%;
    color:#b8b8b8;
    text-align:center;
     
}
</style>
</head>
<body>
    <div id="main">
        <header id="header">
            <div id="logo">
                <span><img src="../image/btn/leftMenu_user.png" /></span>
                <span id="username"></span>
            </div>             
        </header>
        <section>
            <a class="ui" tapmode="ui-hov" onClick="openWin('collection')"><span class="img"><img src="../image/btn/leftMenu_btn1.png" width="100%"></span><span class="info">我的收藏</span></a>
            <a class="navmenu" tapmode="navmenu-hov" onClick="openWin('change_password')"><span class="img"><img src="../image/btn/leftMenu_btn2.png" width="100%"></span><span class="info">修改密码</span></a>
            <a class="function" tapmode="function-hov" onClick="signOut()"><span class="img"><img src="../image/btn/leftMenu_btn3.png" width="100%"></span><span class="info">退出登录</span></a>            
            <a><span>&nbsp;</span></a>            
            <a class="copy_v">
                <img src="../res/logo.png" width="100%" />
                <span>舆情工作平台V2.0.0</span>                            
            </a>
            
        </section>     
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/api.data.js"></script>
<script type="text/javascript" src="../script/jquery.md5.js"></script>
<script type="text/javascript" src="../script/jquery.min.js"></script>
<script>    
     window.apiready = function(){  
          //输出当前用户名
            api.readFile({
                 path:'fs://yqgzpt.txt'
            }, function(ret, err){           
                 var data = eval('('+ret.data+')');  
                 
                 //如果可以找到用户直接输出，否则显示退出
                 if(data.username){
                     document.getElementById("username").innerHTML = data.username;
                 }else{
                     document.getElementById("username").innerHTML = '<span tapmode="function-hov" onClick="loginOut()">重新登录</span>';
                 }                    
            });           
     }
     
             
   
    /* 打开新的窗口. */
    function openWin(category){                    
        api.openWin({
            name: 'unifiedWin',
            url: './unifiedWin.html',
            delay: 300,
            bounces: false,
            vScrollBarEnabled:false,
            hScrollBarEnabled:true,
            pageParam: {category:category}
        }); 
    }
    
    //退出登录
    function signOut(){
         api.confirm({
               title: '退出登录',
               msg: '确定要退出舆情工作平台！',
               buttons:['确定', '取消']
         },function(ret,err){
               if(ret.buttonIndex == 1){
                   loginOut();
               }
         });
    }

 
 
</script>
</html>